package com.example.demo.decorator;

/**
 * @Description
 * @Author youxin
 * @Version V1.0.0
 * @Since 1.0
 * @Date 2022/1/13
 */
public class Decorator extends Drink{
    private Drink obj;
    public Decorator (Drink drink){
        this.obj=drink;
    }
    @Override
    public float cost() {
        return super.getPrice()+ obj.cost();
    }

    public String getDescription(){
        return super.getDes()+""+super.getPrice()+"&&"+obj.getDes();
    }
}
